import 'package:flutter/material.dart';
import './myFonts.dart';

//ListView列表组件
void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('ListView列表组件 垂直图文列表')),
        body: MyHomePage(),
      ),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return ListView(
      padding: EdgeInsets.all(10),
      children: [
        ListTile(
          leading: Image.network("https://www.itying.com/images/flutter/1.png"),
          title: Text('神21瞄准31日23时44分发射'),
          subtitle: Text(
            '希望把科学浪漫和宇宙浩瀚融入新年祝福希望把科学浪漫和宇宙浩瀚融入新年祝福希望把科学浪漫和宇宙浩瀚融入新年祝福希望把科学浪漫和宇宙浩瀚融入新年祝福希望把科学浪漫和宇宙浩瀚融入新年祝福',
            maxLines: 1,
            overflow: TextOverflow.ellipsis,
            style: TextStyle(color: Colors.pink),
          ),
        ),
        Divider(),
        ListTile(
          leading: Image.network("https://www.itying.com/images/flutter/2.png"),
          title: Text('保监局50天开32罚单 “断供”违规资金为房市降温'),
          subtitle: Text("中国天气网讯 保监局50天开32罚单 “断供”违规资金为房市降温"),
        ),
        const Divider(),
        ListTile(
          leading: Image.network("https://www.itying.com/images/flutter/4.png"),
          title: const Text('普京现身俄海军节阅兵：乘艇检阅军舰'),
        ),
        const Divider(),
        ListTile(
          trailing: Image.network(
            "https://www.itying.com/images/flutter/5.png",
          ),
          title: const Text('鸿星尔克捐1个亿帮助困难残疾群体 网友：企业有担当'),
        ),
        const Divider(),
        ListTile(
          leading: Image.network("https://www.itying.com/images/flutter/6.png"),
          title: const Text('行业冥灯？老罗最好祈祷苹果的AR能成'),
          trailing: Image.asset("images/kun.webp", fit: BoxFit.cover),
        ),
      ],
    );
  }
}
